|
Cheloniidae Turtle Graphics is a simple turtle graphics programming library for Java. It is released under the MIT license. Distinguishing characteristics include an extension into three dimensions and the ability to create highly detailed and realistic drawings using colors, solids, antialiased rendering, and incidence angle shading. == Architecture == Cheloniidae is broken into two major pieces: The ''turtle'', which executes drawing commands, and the ''turtle drawing window'', which displays the output. Materially, these are analogous to a piece of chalk and a chalkboard, respectively. To create visible output, a turtle drawing window and a turtle must each be created, the turtle must be added to the window (these steps are handled automatically if your class inherits from SingleTurtleScene), and then drawing commands must be issued to the turtle. This code, for example, will produce a square: import cheloniidae. *; import cheloniidae.frames. *; import static cheloniidae.frames.CoreCommands. *; public class Square extends SingleTurtleScene } Internally, a turtle is represented by an object that produces line segments that are rendered by the window. Other types of turtles may also be used, including those which operate in non-Euclidean space; at present, however, no non-Euclidean turtles are included with the standard Cheloniidae distribution. Multiple turtles can be added as well, allowing for two separate drawings to be produced simultaneously (2.1 code): TurtleDrawingWindow w = new TurtleDrawingWindow (); Turtle t1 = new Turtle (); Turtle t2 = new Turtle (); w.add (t1); w.add (t2); w.setVisible (true); t2.turn (-45); for (int i = 0; i < 4; i++) 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Cheloniidae Turtle Graphics」の詳細全文を読む スポンサード リンク
|